package com.vcredit.creditcat.manager;

import java.text.ParseException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vcredit.creditcat.api.ICustCreditRepositoryManager;
import com.vcredit.creditcat.dto.creditrepository.AuthItemFilterDto;
import com.vcredit.creditcat.dto.creditrepository.AuthItemFilterParamDto;
import com.vcredit.creditcat.dto.creditrepository.CustCreditRepositoryDto;
import com.vcredit.creditcat.dto.creditrepository.ItemStatusDto;
import com.vcredit.creditcat.dto.product.MerchantProductDto;
import com.vcredit.creditcat.model.Cust;
import com.vcredit.creditcat.service.CustCreditRepositoryService;


@Service(protocol = { "protocol1" }, version = "1.0")
public class CustCreditRepositoryManager implements ICustCreditRepositoryManager {

	@Autowired
	private CustCreditRepositoryService custCreditRepositoryService;

	@Override
	public CustCreditRepositoryDto getCustCreditRepository(Long processId) {
		return custCreditRepositoryService.getCustCreditRepository(processId);
	}

	@Override
	public AuthItemFilterDto getAuthItems(AuthItemFilterParamDto param, Long processId) {
		return custCreditRepositoryService.getAuthItems(param, processId);
	}

	@Override
	public ItemStatusDto getStatus(String authItemCode,Integer flag, Cust cust) throws Exception {
		return custCreditRepositoryService.getStatus(authItemCode, flag, cust);
	}

	/**
	 * 查询可以申请的产品
	 * @throws ParseException 
	 */
	@Override
	public List<MerchantProductDto> queryCanApplyProducts(Long custId) throws ParseException {
		return custCreditRepositoryService.queryCanApplyProducts(custId);
	}
}
